package trong.gold.soft.com.model.font;

import javax.microedition.lcdui.Graphics;

/**
 * Abstract font used in Motiven UI API
 * Last modified on January 29, 2009, 4:52 PM
 ** @author phongkstn
 */
public abstract class MotivenFont {
    
    /**
     * Gets the width of a specified character.
     * @param c the specified character
     * @return the width of the input character
     */
    public abstract int getWidth(char c);
    
    
    /**
     * Gets the width of a specified text.
     * @param text the specified text
     * @return the width of the input text
     */
    public abstract int getWidth(String text);
    
    /**
     * Gets the width of a sub string of the given text.
     * @param text  the given text
     * @param start the start position
     * @param end   the end position
     * @return the width of the sub string
     */
    public abstract int getSubWidth(String text, int start, int end);
    
    /**
     * Gets the space width between the 2 contious words.
     * @return the space width
     */
    public abstract int getSpaceWidth();
    
    
    /**
     * Gets the spacing width between the 2 continous characters.
     * @return the spacing width
     */
    public abstract int getSpacingWidth();
    
    
    /**
     * Gets the line spacing height.
     * @return the line spacing height
     */
    public abstract int getLineSpacing();
    
    
    /**
     * Gets the height of this font.
     * @return the height of the font
     */
    public abstract int getHeight();
    
    /**
     * Render a text.
     * @param g
     * @param text
     * @param x
     * @param y
     * @param align
     */
    public abstract void DrawString(Graphics g, String text, int x, int y, int align);
    public abstract void DrawChar(Graphics g, char ch, int x, int y, int align);
    public abstract void DrawSubString(Graphics g, String text, int index, int length, int x, int y, int align);
}
